<template>
  <div class="hello">
    <router-link to="/"></router-link>
    <h2>base3 1111111111</h2>

    <ul>
      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank"
          rel="noopener">babel</a></li>
      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank"
          rel="noopener">eslint</a></li>
    </ul>
    <h5>{{data}} 111111111111</h5>
    <el-upload class="upload-demo" action="/api50/posts" :on-change="handleChange" :data="formParams"
      :file-list="fileList3">
      <el-button size="small" type="primary">点击上传</el-button>
      <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
    </el-upload>
       <el-button size="small" type="primary" @click="setUser">设置用户信息</el-button>

       <div>
                <kt-table :tableData="tableData" :columns="columns" :showIndex="true">
          
        </kt-table>
       </div>
  </div>
</template>

<script>
  import axios from 'axios'
  import ktTable from '../../publicComponents/ktTable.vue'
  export default {
    name: 'HelloWorld',
    components:{
      ktTable
    },
    props: {
      msg: String
    },
    data() {
      return {
        data: "",
        fileList3:[],
        formParams:{
          tid:"1214",
          uuid:"12455"
        },
        tableData:[],
        columns:[
                 {prop:"bsm",label:"业务编号",width:160},
                 {prop:"certificateNo",label:"登记证明号",width:300},
                 {prop:"estateUnit",label:"单元号",width:270},
                 {prop:"certificateNo2",label:"备案号",width:160},
        ]
      }
    },
    created() {
      this.getData();
    },
    methods: {
      getData() {
        axios.get("/api50/test").then(res => {
          console.log(res)
          this.data = res.data.data;
          // test2
        })
      },
      handleChange(){

      },
      setUser(){
        let user = {
          name:"zhanghehe",
          time:new Date().getTime()
        }
        window.sessionStorage.setItem('user',JSON.stringify(user))
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  h3 {
    margin: 40px 0 0;
  }

  ul {
    list-style-type: none;
    padding: 0;
  }

  li {
    display: inline-block;
    margin: 0 10px;
  }

  a {
    color: #42b983;
  }
</style>